<?

class General_Db_Table_Row extends Zend_Db_Table_Row {

	protected $_dependentData = array();

	public function toStdObject() {
		$stdClassObject = new stdClass();
		foreach ($this->_data as $key => $value) {
			$stdClassObject->{$key} = $value;
		}
		foreach ($this->_dependentData as $key => $dependentData) {

			foreach ($dependentData as $primaryKey => $rowClass) {
				$stdClassObject->{$key}[$primaryKey] = $rowClass->toStdObject();
			}

		}
		return $stdClassObject;
	}

	public function fillByParams($params) {
		foreach ($params as $name => $value) {
			if ($this->offsetExists($this->_prefix.'_'.$name)) {
				$this->offsetSet($this->_prefix.'_'.$name, $value);
			}
		}
	}

}